import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../components/Login.vue'



const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: Login
        },
        {
            path: "/index",
            name: 'index',
            component: () => import('../components/Index.vue'),
            children: [
                {
                    path: '/about',
                    name: 'about',
                    component: () => import('../views/AboutView.vue')
                },
                {
                    path: '/menu1',
                    name: 'menu1',
                    component: () => import('../components/Menu1.vue'),
                },
                {
                    path: '/menu2',
                    name: 'menu2',
                    component: () => import('../components/Menu2.vue'),
                },
                {
                    path: '/home',
                    name: '首页',
                    component: HomeView

                }
            ]
        }
    ]
})

export default router
